package com.seal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.seal.comm.utils.Page;
import com.seal.dao.IGroupInfoDao;
import com.seal.dto.GroupInfoDto;
import com.seal.model.GroupInfo;
import com.seal.service.IGroupInfoService;

@Service("groupInfoServiceImpl")
@Transactional(readOnly = true)
public class GroupInfoServiceImpl implements IGroupInfoService{
	@Resource(name= "groupInfoDaoImpl")
	private IGroupInfoDao groupInfoDao;

	@Transactional(readOnly = false,rollbackForClassName="Exception")
	public void addGroupInfo(GroupInfo ca) throws Exception {
		groupInfoDao.addGroupInfo(ca);
	}

	@Transactional(readOnly = false,rollbackForClassName="Exception")
	public void deleteGroupInfo(GroupInfo ca) throws Exception {
		groupInfoDao.deleteGroupInfo(ca);
	}

	public List<GroupInfo> getAllGroupInfo(GroupInfoDto groupDto, Page page) throws Exception {
		return groupInfoDao.getAllGroupInfo(groupDto, page);
	}

	public GroupInfo getGroupInfoById(Long id) throws Exception {
		return groupInfoDao.getGroupInfoById(id);
	}

	@Transactional(readOnly = false,rollbackForClassName="Exception")
	public void updateGroupInfo(GroupInfo ca) throws Exception {
		groupInfoDao.updateGroupInfo(ca);
	}

	public List<GroupInfo> getGroupInfoByMemberId(Long memberId) throws Exception {
		return groupInfoDao.getGroupInfoByMemberId(memberId);
	}
	
}
